The present invention relates to autofocus optical systems, and more particularly to estimation of error in images received through an optical system.
An autofocus optical system (e.g., digital camera, digital video camera, microscope, micro-fabrication device) uses a sensor, a control system and a motor to focus fully automatically or on a manually selected point or area. There are two primary classes of focusing methods that are used by autofocus optical systems to determine the correct focus. One class is referred to as “active” autofocusing. This class of autofocusing determines the focus by emitting a signal (e.g., infrared light, ultrasonic sound wave). In the case of emitting sound waves, the distance to the subject is calculated by measuring the delay in their reflection. In the case of emitting infrared light, the target distance is computed by triangulating the distance to the subject. While active autofocusing methods function in very low light conditions they are unable to focus on very near objects (e.g., macro-photography) and cannot focus through windows because glass reflects the emitted signals.
The other class of autofocusing is referred to as “passive” or “image-based” autofocusing. The focus is determined by analyzing the image entering the optical system. Hence, passive autofocusing methods generally do not direct any energy, such as ultrasonic sound or infrared light waves, toward the subject. The two primary methods of passive autofocusing are contrast measurement and phase detection.
Contrast measurement is achieved by measuring the intensity differences of pixels on the image sensor within a small area. The intensity difference between adjacent pixels of the sensor generally increases with decreasing focus error. The optical system can thereby be adjusted until the maximum contrast is detected. However, this method of focusing is slow because it searches rather than obtains an estimate of the necessary changes in focus. Additionally, the method depends on the assumption that the contrast tracks perfectly with focus error. This assumption is not strictly correct. Furthermore, contrast measurement does not provide an estimate of defocus sign. That is, it does not calculate whether the optical system is focused in front or behind the subject.
Phase detection autofocusing is achieved by dividing the incoming light into pairs of images and comparing them. The system couples a beam splitter, a small secondary mirror, and two optical prisms to direct the light to a dedicated autofocusing sensor in the optical system. Two optical prisms capture the light rays coming from the opposite sides of the lens and divert them to the autofocusing sensor, creating a simple rangefinder with a base similar to the aperture diameter. The two images are then analyzed for similar light intensity patterns (peaks and valleys) and the phase difference is calculated in order to determine the magnitude of the focus error and to determine whether the optical system is focused in front of or behind the subject. While the phase detection method is fast and accurate and estimates defocus sign, it is very costly to implement because it requires special beam splitters, mirrors, prisms, and sensors. Furthermore, the extra hardware increases the size and weight of the optical system. Additionally, such a method cannot operate in “live-view” mode (a feature that allows an optical system's display screen, such as a digital camera's display screen, to be used as a viewfinder).
If, however, a technique could be developed to perform focus error estimation without iterative search and without additional optical components, then one could obtain the benefits of contrast and phase detection methods without their disadvantages.